inherited fmDopUslT: TfmDopUslT
  Left = 570
  Top = 251
  Width = 463
  Height = 326
  Caption = 'fmDopUslT'
  Constraints.MinHeight = 326
  Constraints.MinWidth = 463
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  inherited sbBottom: TStatusBar
    Top = 261
    Width = 447
  end
  inherited Panel1: TPanel
    Width = 447
    inherited BitBtn1: TBitBtn
      Left = 285
    end
    inherited BitBtn2: TBitBtn
      Left = 373
    end
  end
  object cxDBVerticalGrid1: TcxDBVerticalGrid [2]
    Left = 0
    Top = 45
    Width = 447
    Height = 216
    Align = alClient
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -15
    Font.Name = 'Arial'
    Font.Style = []
    OptionsView.RowHeaderWidth = 128
    OptionsBehavior.RowSizing = True
    OptionsBehavior.RowTracking = False
    OptionsBehavior.AllowChangeRecord = False
    OptionsData.CancelOnExit = False
    OptionsData.Appending = False
    OptionsData.Deleting = False
    OptionsData.DeletingConfirmation = False
    ParentFont = False
    TabOrder = 2
    OnMouseDown = cxDBVerticalGrid1MouseDown
    DataController.DataSource = dlgDS
    object cxDBVerticalGrid1DBEditorRow1: TcxDBEditorRow
      Properties.Caption = #1060#1048#1054' '#1091#1095#1080#1090#1077#1083#1103
      Properties.EditPropertiesClassName = 'TcxLookupComboBoxProperties'
      Properties.EditProperties.DropDownRows = 10
      Properties.EditProperties.KeyFieldNames = 'PID'
      Properties.EditProperties.ListColumns = <
        item
          Caption = #1060#1048#1054
          Width = 130
          FieldName = 'PP'
        end
        item
          Caption = #1044#1086#1083#1078#1085#1086#1089#1090#1100
          Width = 100
          FieldName = 'SDNAME'
        end>
      Properties.EditProperties.ListSource = dsSotr
      Properties.DataBinding.FieldName = 'PID'
    end
    object cxDBVerticalGrid1DBEditorRow2: TcxDBEditorRow
      Properties.Caption = #1044#1086#1087'. '#1091#1089#1083#1091#1075#1072
      Properties.EditPropertiesClassName = 'TcxButtonEditProperties'
      Properties.EditProperties.Buttons = <
        item
          Default = True
        end>
      Properties.EditProperties.OnButtonClick = cxDBVerticalGrid1DBEditorRow2EditPropertiesButtonClick
      Properties.DataBinding.FieldName = 'DU'
    end
    object cxDBVerticalGrid1DBEditorRow3: TcxDBEditorRow
      Properties.Caption = #1058#1072#1088#1080#1092
      Properties.DataBinding.FieldName = 'TTARIF'
    end
    object cxDBVerticalGrid1DBEditorRow4: TcxDBEditorRow
      Properties.Caption = #1044#1072#1090#1072' '#1085#1072#1095#1072#1083#1072
      Properties.DataBinding.FieldName = 'TDATEBEGIN'
    end
    object cxDBVerticalGrid1DBEditorRow5: TcxDBEditorRow
      Properties.Caption = #1044#1072#1090#1072' '#1086#1082#1086#1085#1095#1072#1085#1080#1103
      Properties.DataBinding.FieldName = 'TDATEEND'
    end
    object cxDBVerticalGrid1DBEditorRow6: TcxDBEditorRow
      Height = 100
      Properties.Caption = #1050#1086#1084#1084#1077#1085#1090#1072#1088#1080#1081
      Properties.EditPropertiesClassName = 'TcxMemoProperties'
      Properties.DataBinding.FieldName = 'TNOTE'
    end
  end
  object dsSD: TDataSource
    DataSet = qSD
    Left = 203
    Top = 174
  end
  object qSD: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      'SELECT t1.*, SD1.SDISDELETE'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID, o)'
      
        '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID, CAST('#39#39' AS VARCHAR' +
        '(2048)) AS o FROM SYS_DIC SD'
      '      WHERE sd.SDPARID  = :sdparid'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, sd1.SDPARID, '#39' '#39' || o'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT  o || SDNAME AS SDNAME, SDID, SDPARID FROM tree t'
      ') AS t1'
      'INNER JOIN SYS_DIC sd1 ON sd1.SDID = t1.sdid'
      'order by 1'
      '')
    GeneratorField.Field = 'SDID'
    Left = 232
    Top = 176
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'sdparid'
        ParamType = ptUnknown
      end>
    object qSDSDID: TIntegerField
      FieldName = 'SDID'
      ProviderFlags = []
    end
    object qSDSDPARID: TIntegerField
      FieldName = 'SDPARID'
      ProviderFlags = []
    end
    object qSDSDNAME: TIBStringField
      DisplayLabel = #1069#1083#1077#1084#1077#1085#1090
      FieldName = 'SDNAME'
      ProviderFlags = []
      Size = 2304
    end
    object qSDSDISDELETE: TIntegerField
      DisplayLabel = #1059#1076#1072#1083#1080#1090#1100'?'
      FieldName = 'SDISDELETE'
      Origin = '"SYS_DIC"."SDISDELETE"'
    end
  end
  object dsSotr: TDataSource
    DataSet = qSotr
    Left = 288
    Top = 88
  end
  object qSotr: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT D.PID, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,' +
        #39' '#39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      'SD.SDNAME, SD.SDID'
      'FROM DOLJNOST_PEOPLE D'
      'INNER JOIN DOLJNOST DOL ON DOL.DOLID = d.DOLID'
      'INNER JOIN PEOPLE P ON P.PID = D.PID'
      'INNER JOIN SYS_DIC SD ON SD.SDID = DOL.SDID'
      
        'WHERE (CURRENT_DATE BETWEEN D.DOLDATEBEGIN AND COALESCE(d.DOLDAT' +
        'EEND, CURRENT_DATE)) AND d.dolisdelete is null'
      'AND (CURRENT_DATE <= COALESCE(dol.DOLDATEEND, CURRENT_DATE) )'
      'order by 2')
    Left = 320
    Top = 88
    object qSotrPID: TIntegerField
      FieldName = 'PID'
      Origin = '"DOLJNOST"."PID"'
    end
    object qSotrPP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object qSotrSDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qSotrSDID: TIntegerField
      FieldName = 'SDID'
      Origin = '"SYS_DIC"."SDID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
  end
  object qCheck: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      'SELECT T.TID'
      'FROM DOP_USL_TARIFFS T'
      'WHERE t.SDID = :sdid AND t.TID <> :tid AND t.PID = :pid AND'
      'coalesce(T.TDATEEND, current_date) >= :DATE_BEGIN and'
      '      T.TDATEBEGIN <= coalesce(:DATE_END, current_date)')
    Left = 328
    Top = 184
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'sdid'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'tid'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'pid'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'DATE_BEGIN'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'DATE_END'
        ParamType = ptUnknown
      end>
  end
end
